<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ViewHistoricoDocumentoTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" styleClass="ajustaListaMensagemErro"  layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="list"/>
            </h:panelGroup>
            <h:form>

                <p:growl id="messages" life="3000"/>

                <p:panel>
                    <f:facet name="header">
                        <h:outputText value="#{bundle.LegendHistoricoDocumentoTitle}"></h:outputText>    
                    </f:facet>

                    <h:panelGrid columns="2">
                        <h:outputText value="#{bundle.ViewHistoricoDocumentoLabel_hdcId}"/>
                        <h:outputText value="#{historicoDocumentoController.selected.hdcId}" title="#{bundle.ViewHistoricoDocumentoTitle_hdcId}"/>
                        <h:outputText value="#{bundle.ViewHistoricoDocumentoLabel_hdcDt}"/>
                        <h:outputText value="#{historicoDocumentoController.selected.hdcDt}" title="#{bundle.ViewHistoricoDocumentoTitle_hdcDt}">
                            <f:convertDateTime pattern="#{bundle.patternApp}" />
                        </h:outputText>
                        <h:outputText value="#{bundle.ViewHistoricoDocumentoLabel_hdcTxObservacao}"/>
                        <h:outputText value="#{historicoDocumentoController.selected.hdcTxObservacao}" title="#{bundle.ViewHistoricoDocumentoTitle_hdcTxObservacao}"/>
                        <h:outputText value="#{bundle.ViewHistoricoDocumentoLabel_hdcTopId}"/>
                        <h:outputText value="#{historicoDocumentoController.selected.hdcTopId}" title="#{bundle.ViewHistoricoDocumentoTitle_hdcTopId}"/>
                        <h:outputText value="#{bundle.ViewHistoricoDocumentoLabel_hdcShdId}"/>
                        <h:outputText value="#{historicoDocumentoController.selected.hdcSdcId}" title="#{bundle.ViewHistoricoDocumentoTitle_hdcShdId}"/>
                        <h:outputText value="#{bundle.ViewHistoricoDocumentoLabel_hdcTcmId}"/>
                        <h:outputText value="#{historicoDocumentoController.selected.hdcTcmId}" title="#{bundle.ViewHistoricoDocumentoTitle_hdcTcmId}"/>

                        <h:outputLabel value="#{bundle.createBy}" for="nomeCriador" rendered="#{not empty historicoDocumentoController.criacaoHist.nomeUsuario}"/>
                        <h:outputText id="nomeCriador" value="#{historicoDocumentoController.criacaoHist.nomeUsuario}" rendered="#{not empty historicoDocumentoController.criacaoHist.nomeUsuario}"/>
                        <h:outputLabel value="#{bundle.createDate}" for="dataCriacao" rendered="#{not empty historicoDocumentoController.criacaoHist.dataHora}"/>
                        <h:outputText id="dataCriacao" value="#{historicoDocumentoController.criacaoHist.dataHora}" rendered="#{not empty historicoDocumentoController.criacaoHist.dataHora}"/>     
                        <h:outputLabel value="#{bundle.updateBy}" for="nomeAlterador" rendered="#{not empty historicoDocumentoController.alteracaoHist.nomeUsuario}"/>
                        <h:outputText id="nomeAlterador" value="#{historicoDocumentoController.alteracaoHist.nomeUsuario}" rendered="#{not empty historicoDocumentoController.alteracaoHist.nomeUsuario}"/>
                        <h:outputLabel value="#{bundle.updateDate}" for="dataAlteracao" rendered="#{not empty historicoDocumentoController.alteracaoHist.dataHora}"/>
                        <h:outputText id="dataAlteracao" value="#{historicoDocumentoController.alteracaoHist.dataHora}" rendered="#{not empty historicoDocumentoController.alteracaoHist.dataHora}" /> 
                    </h:panelGrid>
                    <br />

                    <p:commandButton id="deleteCommand" rendered="#{autenticadorController.loginAdmin}"  onclick="confirmationDestroy.show()" value="#{bundle.ViewHistoricoDocumentoDestroyLink}" type="button" icon="ui-icon-trash" />&nbsp;
                    <p:commandButton ajax="false" rendered="#{!autenticadorController.loginVisualizador}"  action="Edit" value="#{bundle.ViewHistoricoDocumentoEditLink}"/> &nbsp;                    
                    <p:commandButton ajax="false" action="#{historicoDocumentoController.prepareList}" value="#{bundle.ViewHistoricoDocumentoShowAllLink}" immediate="true"/>                    

                </p:panel>

                <p:confirmDialog id="confirmDestroy" message="#{bundle.MsgConfirmDestroy_message}" header="#{bundle.MsgConfirmDestroy_header}" severity="alert" widgetVar="confirmationDestroy">
                    <p:commandButton id="confirm" ajax="false" value="#{bundle.MsgDialog_confirmar}"  oncomplete="confirmationDestroy.hide();" action="#{historicoDocumentoController.destroy}" />
                    <p:commandButton id="decline"  value="#{bundle.MsgDialog_cancelar}" update="messages" onclick="confirmationDestroy.hide()" type="button"/>
                </p:confirmDialog>

            </h:form>
        </ui:define>
    </ui:composition>

</html>
